Home:ALL Converter>Xcode asset catalogue `Alignment` properties are ignored for `imageWithName:`

Xcode asset catalogue `Alignment` properties are ignored for `imageWithName:`

Ask Time:2016-06-17T21:27:39         Author:Benjohn

Json Formatter

The Xcode asset catalogue editor supports an Alignment property for images. It very much seems like this is intended as a mechanism for setting a UIImage's alignmentRectInsets, and Apple's Asset catalogue reference strongly suggests this too:

alignment-insets

Dictionary

The insets for alignmentRectInsets in UIImage or for alignmentRect in NSImage. The inset tag can be omitted.

However, when I load images from a catalogue that I've set an Alignment on with the editor, it don't get an alignment.

I'm loading images using [UIImage imageNamed:].

Is this a known bug, or is there some subtlety I am missing?

Author:Benjohn,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/37882841/xcode-asset-catalogue-alignment-properties-are-ignored-for-imagewithname
yy